<cfparam default="none" name="url.api" />
<cfparam default="0" name="FORM.Manual" />

<cfscript>
    //t = CreateObject("component", session.RootDir & ".utilities.Termination").init(FORM.TermReqID, FORM.Manual);
    //writeDump(t);
    //writeOutput(SerializeJSON({STATUS = "Completed", MESSAGE="<strong>Success</strong>", RESULT="0"}, true));
</cfscript>


<cfif url.api eq "ADDisable" >
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >            
            <cfsetting enablecfoutputonly="true">
            <cfscript>
                t = CreateObject("component", session.RootDir & ".utilities.Termination").init(FORM.TermReqID, FORM.Manual);
                writeOutput(SerializeJSON(t.ADDisable(), true));
                //writeOutput(SerializeJSON({STATUS = "Completed", MESSAGE="<strong>Success</strong>", RESULT="0"}, true));
            </cfscript>
        </cfcase>    
    </cfswitch>
</cfif>


<cfif url.api eq "HomeFolderArchive" >
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >            
            <cfsetting enablecfoutputonly="true">
            <cfscript>
                t = CreateObject("component", session.RootDir & ".utilities.Termination").init(FORM.TermReqID, FORM.Manual);
                writeOutput(SerializeJSON(t.HomeFolderArchive(), true));
                //writeOutput(SerializeJSON({STATUS = "Completed", MESSAGE="<strong>Success</strong>", RESULT="0"}, true));
            </cfscript>
        </cfcase>    
    </cfswitch>
</cfif>


<cfif url.api eq "HRDisable" >
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >            
            <cfsetting enablecfoutputonly="true">
            <cfscript>
                t = CreateObject("component", session.RootDir & ".utilities.Termination").init(FORM.TermReqID, FORM.Manual);
                writeOutput(SerializeJSON(t.HRDisable(), true));
                //writeOutput(SerializeJSON({STATUS = "Completed", MESSAGE="<strong>Success</strong>", RESULT="0"}, true));
            </cfscript>
        </cfcase>    
    </cfswitch>
</cfif>


<cfif url.api eq "TimeKeeperDisable" >
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >            
            <cfsetting enablecfoutputonly="true">
            <cfscript>
                t = CreateObject("component", session.RootDir & ".utilities.Termination").init(FORM.TermReqID, FORM.Manual);
                writeOutput(SerializeJSON(t.TimeKeeperDisable(), true));
                //writeOutput(SerializeJSON({STATUS = "Completed", MESSAGE="<strong>Success</strong>", RESULT="0"}, true));
            </cfscript>
        </cfcase>    
    </cfswitch>
</cfif>


<cfif url.api eq "ExportEmail" >
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >            
            <cfsetting enablecfoutputonly="true">
            <cfscript>
                t = CreateObject("component", session.RootDir & ".utilities.Termination").init(FORM.TermReqID, FORM.Manual);
                writeOutput(SerializeJSON(t.EmailExport(), true));
                //writeOutput(SerializeJSON({STATUS = "Completed", MESSAGE="<strong>Success</strong>", RESULT="0"}, true));
            </cfscript>
        </cfcase>    
    </cfswitch>
</cfif>


<cfif url.api eq "KronosUserAccountDisable" >
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >            
            <cfsetting enablecfoutputonly="true">
            <cfscript>
                t = CreateObject("component", session.RootDir & ".utilities.Termination").init(FORM.TermReqID, FORM.Manual);
                writeOutput(SerializeJSON(t.UserAccountDisable(), true));
                //writeOutput(SerializeJSON({STATUS = "Completed", MESSAGE="<strong>Success</strong>", RESULT="0"}, true));
            </cfscript>
        </cfcase>    
    </cfswitch>
</cfif>


<cfif url.api eq "RosettaDisable" >
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >            
            <cfsetting enablecfoutputonly="true">
            <cfscript>
                t = CreateObject("component", session.RootDir & ".utilities.Termination").init(FORM.TermReqID, FORM.Manual);
                writeOutput(SerializeJSON(t.RosettaDisable(), true));
                //writeOutput(SerializeJSON({STATUS = "Completed", MESSAGE="<strong>Success</strong>", RESULT="0"}, true));
            </cfscript>
        </cfcase>    
    </cfswitch>
</cfif>


<cfif url.api eq "TerminationComplete" >
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >            
            <cfsetting enablecfoutputonly="true">
            <cfscript>
                t = CreateObject("component", session.RootDir & ".utilities.Termination").init(FORM.TermReqID, FORM.Manual);
                writeOutput(SerializeJSON(t.TerminationCompletion(), true));
                //writeOutput(SerializeJSON({STATUS = "Completed", MESSAGE="<strong>Success</strong>", RESULT="0"}, true));
            </cfscript>
        </cfcase>    
    </cfswitch>
</cfif>